package net.thxjj.netty;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;

import java.util.logging.Logger;

public class DeviceRespChannelOutBoundHandler extends ChannelOutboundHandlerAdapter {

    private Logger log = Logger.getLogger(String.valueOf(this.getClass()));

    @Override
    public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
        String de = msg.toString();
        log.info(de);
        ctx.writeAndFlush(de+"\r\n");
    }
}
